/*
 * FrameDelegate.h  0.4.0 / Dec 05, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef FRAMEDELEGATE_H
#define FRAMEDELEGATE_H

#include "Cute4jSwing.h"

#include "WindowDelegate.h"

// FrameDelegate Class. --------------------------------------------------------

/*!
 * \brief Frame Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT FrameDelegate : public WindowDelegate
{
  Q_OBJECT
protected:
  FrameDelegate(JNIEnv *env, jobject obj);
public slots: // native calls
  void setMenuBar(JNIEnv *env, jlong menuBarDelegate);
  void addToolBar(JNIEnv *env, jlong toolBarDelegate);
  void removeToolBar(JNIEnv *env, jlong toolBarDelegate);
  void setContentPane(JNIEnv *env, jlong contentPaneDelegate);
  void setStatusBar(JNIEnv *env, jlong statusBarDelegate);
public: // native calls
  static jlong newInstance(JNIEnv *env, jobject obj);
public:
  inline QMainWindow *qMainWindow() const;
};

// FrameDelegate :: Public Inline Member Function. -----------------------------

/*!
 * \brief Returns QMainWindow adaptee.
 *
 * \return QMainWindow adaptee
 */
inline QMainWindow *FrameDelegate::qMainWindow() const
{
  return static_cast<QMainWindow *>(qObject());
}

// Macro Definition. -----------------------------------------------------------

#define FRAME_DELEGATE (reinterpret_cast<FrameDelegate *>(delegate))

#endif // FRAMEDELEGATE_H
